// bind
function fn(a, b, c) {
  console.log(a, b, c);
}

const f = fn.bind(globalThis, 1, 2);
f(3);

const f1 = fn.bind(globalThis, 1);
f(2, 3);

Function.prototype.mybind = function (context, ...args) {
  return (...rest) => this.call(context, ...args, ...rest);
};

function t(a, b, c) {
  return a + b + c;
}

t.mybind();

const sumFn = t.mybind(this, 1, 2);
const sum = sumFn(3);
console.log(sum);
